package com.youpingou.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @auther Created by yuanxinqi 
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "tb_category")
public class Category {
    @TableId(type = IdType.AUTO)
    private Integer id;
    @TableField(value = "cat_name")
    @JsonProperty("cat_name")
    private String catName;
    @TableField(value = "parent_id")
    @JsonProperty("parent_id")
    private Integer parentId;
    @TableField(exist = false)
    private List<Category> children;


}